package com.ccl.iot;


public class IOTNetAPIEnum extends IOTNetAPIConst {
	/**
	 * IP地址类型
	 */
	public enum EIP_TYPE{
		;
		public static final int EIP_TYPE_V4 = 0;		//IPV4: XX.XX.XX.XX
		public static final int EIP_TYPE_V6 =1;		//IPV6: XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
	}

	/**
	 * 网络类型
	 */
	public enum EIOT_NETWORK_TYPE{
		;
		public static final int EIOT_NETWORK_TYPE_LOCAL = 0;		//局域网
		public static final int EIOT_NETWORK_TYPE_REMOTE = 1;	//CCLIOT物联网
		public static final int EIOT_NETWORK_TYPE_BOTH = 2;		//局域网及CCLIOT物联网
	}
	
	/**
	 * 安全信息类型
	 */
	public enum ESECURITY_INFO_TYPE{
		;
		public static final short ESECURITY_INFO_TYPE_MOBILE = 0;		//移动电话
		public static final short ESECURITY_INFO_TYPE_EMAIL = 1;		//电子邮箱
		public static final short ESECURITY_INFO_TYPE_FPANSWER = 2;	//忘记密码问题
	}
	
	/**
	 * 权限状态
	 */
	public enum EAUTH_STATE{
		;
		public static final int EAUTH_STATE_UNKNOWN = -1;	//未知权限
		
		public static final int EAUTH_STATE_NONE = '\0';	//无权限

		public static final int EAUTH_STATE_FREE = 'E';	//自由权限，也即任何用户都有作为拥有者的权限
		
		public static final int EAUTH_STATE_OWNER = 'O';	//拥有者权限，可对设备进行重启、恢复出厂设备、升级设备固件、分配设备权限、写设备扩展信息等所有操作

		public static final int EAUTH_STATE_WAITTING = 'A';	//等待授权中
		public static final int EAUTH_STATE_READ = 'R';	//只读权限
		public static final int EAUTH_STATE_WRITE = 'W';	//只写权限
		public static final int EAUTH_STATE_FULL = 'F';	//完全控制权限，可对设备进行读写寄存器操作
		public static final int EAUTH_STATE_REJECT = 'J';	//被拒绝
		public static final int EAUTH_STATE_QUIT = 'Q';		//已抛弃权限
		
		/**
		 * 判断是指定的权限状态是否具有拥有者权限
		 * @param aAuth	-	需要判断的权限状态
		 * @return true表示有拥有者权限，false表示无拥有者权限
		 */
		public static boolean IS_OWNER_AUTH(int aAuth){
			return aAuth == EAUTH_STATE_FREE ||  aAuth == EAUTH_STATE_OWNER;		
		}
		
		/**
		 * 判断是指定的权限状态是否具有完全权限
		 * @param aAuth	-	需要判断的权限状态
		 * @return true表示有完全权限，false表示无完全权限
		 */
		public static boolean IS_FULL_AUTH(int aAuth){
			return aAuth == EAUTH_STATE_FULL || IS_OWNER_AUTH(aAuth);
		}
		
		/**
		 * 判断是指定的权限状态是否具有读权限
		 * @param aAuth	-	需要判断的权限状态
		 * @return true表示有读权限，false表示无读权限
		 */
		public static boolean IS_READABLE(int aAuth){
			return aAuth == EAUTH_STATE_READ || IS_FULL_AUTH(aAuth);
		}
		
		/**
		 * 判断是指定的权限状态是否具有写权限
		 * @param aAuth	-	需要判断的权限状态
		 * @return true表示有写权限，false表示无写权限
		 */
		public static boolean IS_WRITABLE(int aAuth){
			return aAuth == EAUTH_STATE_WRITE || IS_FULL_AUTH(aAuth);
		}
		
		/**
		 * 判断是指定的权限状态是否具有请求权限
		 * @param aAuth	-	需要判断的权限状态
		 * @return true表示可请求权限，false表示不可请求权限
		 */
		public static boolean IS_REQUESTABLE(int aAuth){
			return aAuth == EAUTH_STATE_NONE || aAuth == EAUTH_STATE_FREE ||  aAuth == EAUTH_STATE_WAITTING || aAuth == EAUTH_STATE_QUIT;
		}
		
		/**
		 * 判断是指定的权限状态是否具有有效权限
		 * @param aAuth	-	需要判断的权限状态
		 * @return true表示有有效权限，false表示无有效权限
		 */
		public static boolean IS_VALID_AUTH(int aAuth){
			return IS_READABLE(aAuth) || IS_WRITABLE(aAuth);
		}
	}
	
	/**
	 * 批处理状态
	 */
	public enum EBATCH_STATE{
		;
		public static final int EBATCH_STATE_UNKNOWN = -1;		//未知状态
		
		public static final int EBATCH_STATE_VALID = 'V';				//有效
		public static final int EBATCH_STATE_FORBIDDEN = 'F';	//被禁止
	}
	
	/**
	 * 通知类型
	 */
	public enum ENOTIFY_TYPE{
		;
		/**
		 * 收到新的即时通讯消息
		 * @param aRelativeUser	-	发送消息的用户
		 * @param aRelativeDevice	-	发送消息的设备
		 * @param aContent			-	UTF-8格式的文本
		 */
		public static final int ENOTIFY_TYPE_NEW_MESSAGE = 0x2200;

		/**
		 * 收到用户请求获取拥有设备的相关权限
		 * @param aRelativeUser	-	请求权限的用户
		 * @param aRelativeDevice	-	请求权限的设备
		 * @param aContent			-	NULL
		 */
		public static final int ENOTIFY_TYPE_AUTH_REQUEST = 0x3B01;
		/**
		 * 当前账号下关联的设备权限被更新了，应该分两种情况处理：
		 * 1：被更新权限的设备是当前账号拥有的，则多数情况为用户放弃了对设备的权限而收到更新的权限状态为EAUTH_STATE_QUIT
		 * 2：被更新权限的设备不是当前账号拥有的，则表示此设备的拥有者为当前账号分配了新的权限
		 * @param aRelativeUser	-	更新设备权限的用户
		 * @param aRelativeDevice	-	被更新权限的设备
		 * @param aContent			-	设备被更新的最终权限状态，占用1个字符，详见：{@link EAUTH_STATE}
		 */
		public static final int ENOTIFY_TYPE_AUTH_UPDATE = 0x3B02;

		/**
		 * 设备寄存器改变了
		 * @param aRelativeUser	-	设备本身代表的用户，非拥有者
		 * @param aRelativeDevice	-	改变寄存器的设备
		 * @param aContent			-	寄存器改变对应的记录ID，格式为64位的无符号整型字符串，可通过查询寄存器改变记录进行查询
		 */
		public static final int ENOTIFY_TYPE_REGISTER_CHANGE = 0x4300;
		
		/**
		 * 批处理执行结果
		 * @param aRelativeUser	-	执行批处理的用户
		 * @param aRelativeDevice	-	批处理项目中一个关联的在线设备
		 * @param aContent			-	批处理ID及执行成功的批处理项目数量，以“=”分隔
		 *												如：1234=10		-	表示批处理ID为1234，成功执行的批处理项目数量为10个
		 */
		public static final int ENOTIFY_TYPE_BATCH_EXECUTE_RESULT = 0x5120;
	}
	

	/**
	 * 推送协议
	 */
	public enum EPUSH_PROTOCOL{
		;
		public static final int EPUSH_PROTOCOL_UNKNOWN = 0;	//未知协议
	
		public static final int EPUSH_PROTOCOL_XINGE = EPUSH_PROTOCOL_UNKNOWN + 1;	//腾讯信鸽协议
	}
	
	/**
	 * 推送接收器类型
	 */
	public enum EPUSH_RECEIVER_TYPE{
		;
		public static final int EPUSH_RECEIVER_TYPE_UNKNOWN = 0;	//未知类型
	
		public static final int EPUSH_RECEIVER_TYPE_ANDROID = 1;	//Android设备
		public static final int EPUSH_RECEIVER_TYPE_IOS = 2;		//iOS设备
		public static final int EPUSH_RECEIVER_TYPE_WINDOWS = 3;	//Windows设备
	
		public static final int EPUSH_RECEIVER_TYPE_ALL = 0xFF;	//所有类型
	}
	
	/**
	 * 推送信息类型
	 */
	public enum EPUSH_NOTIFY_TYPE{
		;
		public static final int EPUSH_NOTIFY_TYPE_NORMAL = 0;	//一般信息
		public static final int EPUSH_NOTIFY_TYPE_TIP = 1;		//提示信息
		public static final int EPUSH_NOTIFY_TYPE_WARNING = 2;	//警告信息
		public static final int EPUSH_NOTIFY_TYPE_ALARM = 3;		//警报信息
	}
	
	/**
	 * 推送触发器类型
	 */
	public enum EPUSH_TRIGGER_TYPE{
		;
		public static final int EPUSH_TRIGGER_TYPE_UNKNOWN = 0;
		
		public static final int EPUSH_TRIGGER_TYPE_STATUS = 0x10000000;		//状态相关触发
		public static final int EPUSH_TRIGGER_TYPE_STATUS_DEVICE_OFFLINE = EPUSH_TRIGGER_TYPE_STATUS + 1;	//设备离线触发
		public static final int EPUSH_TRIGGER_TYPE_STATUS_DEVICE_ONLINE = EPUSH_TRIGGER_TYPE_STATUS + 2;	//设备上线触发
		public static final int EPUSH_TRIGGER_TYPE_STATUS_USER_OFFLINE = EPUSH_TRIGGER_TYPE_STATUS + 3;		//用户离线触发
		public static final int EPUSH_TRIGGER_TYPE_STATUS_USER_ONLINE = EPUSH_TRIGGER_TYPE_STATUS + 4;		//用户上线触发
	
		public static final int EPUSH_TRIGGER_TYPE_DEVICE = 0x20000000;		//设备相关触发
		public static final int EPUSH_TRIGGER_TYPE_DEVICE_REGISTER_CHANGE = EPUSH_TRIGGER_TYPE_DEVICE + 1;	//设备寄存器改变触发
	
		public static final int EPUSH_TRIGGER_TYPE_USER = 0x30000000;		//用户相关触发
	
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER = 0x50000000;	//特定设备寄存器触发
		
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_32 = 0x500A2000;	//双路开关相关触发
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_32_STATE = EPUSH_TRIGGER_TYPE_SPEC_REGISTER_32 + 1;			//双路开关状态改变触发
		
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2 = 0x500A2000;	//5525相关触发
		
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_51 = 0x500A2100;	//5525安装16路防盗探头驱动时的相关触发
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_51_TRIGGER = EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_51 + 1;			//5525安装16路防盗探头驱动时被触发次数变化后触发，Param对应值为相应的通道编号
	
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52 = 0x500A2200;	//5525安装32路防盗主机驱动时的相关触发
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52_ERROR = EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52 + 1;			//5525安装32路防盗主机驱动时有错误产生后触发
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52_PARTITION_STATE = EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52 + 2;	//5525安装32路防盗主机驱动时分区状态变化后触发，Param对应值为分区编号
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52_ZONE_LINE = EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52 + 3;		//5525安装32路防盗主机驱动时防区线路状态变化后触发，Param对应值为防区编号
		public static final int EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52_ZONE_STATE = EPUSH_TRIGGER_TYPE_SPEC_REGISTER_A2_52 + 4;		//5525安装32路防盗主机驱动时防区状态变化后触发，Param对应值为防区编号
	}
}
